<?php


function viewPost( $type='list', $loginUser, $blogUser, $url, $post, $text, $articleUrl ) 
{

    // 請注意 no cache 的問題
    if( $loginUser ) {
        $editUrl = $url->get('adminBlogArticle','edit',$post);
        $editString = '<a href="#" class="openWorkWin" situs="'. $editUrl .'" ><img src="'. $url->getBasePath() .'/imgs/icons/basic_16/edit-16.png" /></a>';
    }

    if( 'list'==$type ) {

        echo <<<EOD
            <div class="post-4 post type-post status-publish format-standard hentry category-1 post" id="post-4">
                <!-- post div -->
                <h2 class="title">
                    {$editString} <a href="{$articleUrl}" title="Permalink to {$text->getTopic()}">{$text->getTopic()}</a>
                </h2>
                <div class="post-info-top">
                    <span class="post-info-date">
                        日期: <a href="#" title="上午 9:14" rel="bookmark">{$post->getUpdateDateByFormat()}</a> ,
                        作者: {$blogUser->getAccount()}
                    </span>
                    <span id="gotocomments">
                        <a href="#" title="《aaaaaaaaaa》上的評論">沒有評論</a>
                    </span>
                </div>
                <div class="clear"></div>
                <div class="entry">{$text->getText()}</div>
            </div>
            <!-- post end -->
EOD;

    }
    elseif( 'full'==$type ) {

        echo <<<EOD
            <div class="post-4 post type-post status-publish format-standard hentry category-1 post-single" id="post-4">
                <!-- post div -->
                <h2 class="title title-single">
                    {$editString} <a href="{$articleUrl}" title="Permalink to {$text->getTopic()}">{$text->getTopic()}</a>
                </h2>
                <div class="post-info-top">
                    <span class="post-info-date">
                        日期: <a href="#" title="上午 9:14" rel="bookmark">{$post->getUpdateDateByFormat()}</a> ,
                        作者: {$blogUser->getAccount()}
                    </span>
                    <span id="addcomment"><a href="#respond"  rel="nofollow" title="Leave a comment ?">發表評論</a> (0)</span> 
                    <span id="gotocomments"><a href="#comments"  rel="nofollow" title="Go to comments ?">查看評論</a></span> 
                </div>
                <div class="clear"></div>
                <div class="entry">{$text->getText()}</div>
                <div class="add-info"></div> 
                <div class="post-info-bottom"> 
                    <span class="post-info-category"><a href="#" title="查看 未分類 中的全部文章" rel="category">未分類</a></span>
                    <span class="post-info-tags"></span> 
                </div>
            </div>
            <!-- post end -->
EOD;

    }

}
















//